package cn.zysuyuan;

import com.github.pagehelper.PageHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @author flypig
 * @version 1.0
 * @date 2019-11-25 14:35
 */

@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("cn.zysuyuan.user.mapper")
@Configuration
@FeignClient
public class ZysuyuanUserApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZysuyuanUserApplication.class);
    }

    @Bean
    public PageHelper getPageHelper(){
        PageHelper pageHelper=new PageHelper();
        Properties properties=new Properties();
        properties.setProperty("helperDialect","mysql");
        properties.setProperty("reasonable","true");
        properties.setProperty("supportMethodsArguments","true");
        properties.setProperty("params","count=countSql");
        pageHelper.setProperties(properties);
        return pageHelper;
    }
}
